PATH
WebObjects 4.5 Documentation >
Tools and Techniques
Dynamic Hyperlinks
Dynamic hyperlinks (WOHyperlink) allow you to specify the link's destination at run time rather than at compile time. There are several ways to do this:
-
You can specify the name of a page in your application as the destination of the link. To do this, bind the name to the WOHyperlink's pageName
attribute. This is useful since pages in a WebObjects application don't have predictable URLs that you can specify in an HTML hyperlink.
-
You can specify an action to be performed when the hyperlink is clicked by binding WOHyperlink's action
attribute to an action method in your code. This method can perform any sort of action, as well as returning a page as the destination.
-
You can also specify a URL as the destination by binding to the href
attribute.
To create a dynamic hyperlink:
-
Click
in the toolbar.
-
Replace the word
Hyperlink
with the text of the link.
-
Create the element's bindings.
To learn how to create a static hyperlink, see
Setting Page Attributes
.
© 1999 Apple Computer, Inc. – (Last Updated July 27 99)